import request from '@/utils/request'
// 封装获取角色详情API
export const getRoleListAPI = (params) => {
  return request({ url: '/sys/role', params })
}
// 封装增加角色API
export const addRoleAPI = (data) => {
  return request({ url: '/sys/role', method: 'post', data })
}
// 封装删除角色API
export const delRoleAPI = (id) => {
  return request({ url: `/sys/role/${id}`, method: 'delete' })
}
// 封装编辑角色API
export const editRoleAPI = (data) => {
  return request({ url: `/sys/role/${data.id}`, method: 'put', data })
}
// 封装获取单个角色的详情
export const getOddRoleAPI = (id) => {
  return request({
    url: `/sys/role/${id}`
  })
}
// 封装分配角色权限API
export const allotRoleJurisdictionAPI = (data) => {
  return request({
    method: 'put',
    url: '/sys/role/assignPrem',
    data
  })
}

